// Name:                       Code
// Description:                Defines styles for code
//
// Modifiers:                  `.pre-scrollable`
//
// ==========================================================================


/* Inline and block code styles */

code,
kbd,
pre,
samp {
  font-family: @font-family-monospace;
}

/* Inline code */

code {
  padding: 2px 4px;
  font-size: @code-font-size;
  color: @code-color;
  background-color: @code-bg;
  white-space: nowrap;
  border-radius: @global-border-radius;
}


/* Code block */

pre {
  display: block;
  padding: 1rem;
  margin: 1rem  0;
  font-size: @code-font-size;
  line-height: @line-height-base;
  word-break: break-all;
  word-wrap: break-word;
  color: @pre-color;
  background-color: @pre-bg;
  border: @pre-border;
  border-radius: @global-border-radius;

  // Account for some code outputs that place code tags in pre tags
  code {
    padding: 0;
    font-size: inherit;
    color: inherit;
    white-space: pre-wrap;
    background-color: transparent;
    border-radius: 0;
  }
}


/* Enable scrollable blocks of code */

.am-pre-scrollable {
  max-height: @pre-scrollable-max-height;
  overflow-y: scroll;
  .am-pre-scrollable;
}


// Hooks

.am-pre-scrollable() {}